//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#define SINGERS 10
//#define JUDGES 6
//
//struct Singer {
//	int id;
//	int scores[JUDGES];
//	double final_score;
//};
//
//void inputScores(struct Singer singers[]) {
//	printf("Please input singer's score:\n");
//	for (int i = 0; i < SINGERS; i++) {
//		for (int j = 0; j < JUDGES; j++) {
//			scanf("%d", &singers[i].scores[j]);
//		}
//	}
//}
//void calculateFinalScores(struct Singer singers[]) {
//	for (int i = 0; i < SINGERS; i++) {
//		int max_score = singers[i].scores[0];
//		int min_score = singers[i].scores[0];
//		double total_score = 0;
//
//
//		for (int j = 0; j < JUDGES; j++) {
//			if (singers[i].scores[j] > max_score) {
//				max_score = singers[i].scores[j];
//			}
//			if (singers[i].scores[j] < min_score) {
//				min_score = singers[i].scores[j];
//			}
//			total_score += singers[i].scores[j];
//		}
//
//
//		total_score = (total_score - max_score - min_score) / (JUDGES - 2.0);
//		singers[i].final_score = total_score;
//	}
//}
//
//
//void sortAndOutput(struct Singer singers[]) {
//
//	for (int i = 0; i < SINGERS - 1; i++) {
//		for (int j = 0; j < SINGERS - i - 1; j++) {
//			if (singers[j].final_score < singers[j + 1].final_score) {
//
//				struct Singer temp = singers[j];
//				singers[j] = singers[j + 1];
//				singers[j + 1] = temp;
//			}
//		}
//	}
//
//
//	printf("scores:\n");
//	for (int i = 0; i < SINGERS; i++) {
//		printf("No.%d: %.2f\n", singers[i].id, singers[i].final_score);
//	}
//}
//
//int main() {
//	struct Singer singers[SINGERS];
//
//	for (int i = 0; i < SINGERS; i++) {
//		singers[i].id = i + 1;
//	}
//
//	inputScores(singers);
//	calculateFinalScores(singers);
//	sortAndOutput(singers);
//
//	return 0;
//}
